import React from 'react'
import {useRoutes ,Navigate} from 'react-router-dom'
import Home from "../components/Home"
import About from "../components/About"
import Add from "../components/Add"
import Detail from '../components/Detail'
import Email from '../components/about/Email'
import Tell from '../components/about/Tell'

export default function Router() {
  return useRoutes([
        {
            path:'/home',
            element:<Home />
        },
        {
            path:'/about',
            element:<About />,
            children:[
                {
                    path:'email',
                    element:<Email />
                },
                {
                    path:'tell',
                    element:<Tell />
                },
                {
                    path:'',
                    element:<Navigate replace to="email" />
                },
            ]
        },
        {
            path:'/Add',
            element:<Add />
        },
        {
            path:'/detail',
            element:<Detail />
        },
        {
            path:'/',
            element:<Navigate replace to="home" />
        },
  ])
}
